package com.tark.service.qrcode.pojo;

import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;

public class QrcodePojo {
private String  content;//二维码内容
private Integer length;//边长
private String  barcodeFormat;//编码格式
private String  basePath;//存放文件夹
private String  fileName;//二维码生成图片名称（包含后缀名）
private String  logoFullPath;//logo图片的全路径


//不想给用户写的数据 我直接写死了  但是不写成final 
private final static Integer onColor = 0xFF000000;  //前景色
private final static Integer offColor = 0xFFFFFFFF; //背景色
private final static Integer margin = 1;            //白边大小，取值范围0~4
private final static  ErrorCorrectionLevel level = ErrorCorrectionLevel.H;  //二维码容错率
public String getContent() {
	return content;
}
public void setContent(String content) {
	this.content = content;
}
public Integer getLength() {
	return length;
}
public void setLength(Integer length) {
	this.length = length;
}
public String getBarcodeFormat() {
	return barcodeFormat;
}
public void setBarcodeFormat(String barcodeFormat) {
	this.barcodeFormat = barcodeFormat;
}
public String getBasePath() {
	return basePath;
}
public void setBasePath(String basePath) {
	this.basePath = basePath;
}
public String getFileName() {
	return fileName;
}
public void setFileName(String fileName) {
	this.fileName = fileName;
}
public String getLogoFullPath() {
	return logoFullPath;
}
public void setLogoFullPath(String logoFullPath) {
	this.logoFullPath = logoFullPath;
}
public static Integer getOnColor() {
	return onColor;
}

public static Integer getOffColor() {
	return offColor;
}

public static Integer getMargin() {
	return margin;
}

public static ErrorCorrectionLevel getLevel() {
	return level;
}

@Override
public String toString() {
	return "QrcodePojo [content=" + content + ", length=" + length + ", barcodeFormat=" + barcodeFormat + ", basePath="
			+ basePath + ", fileName=" + fileName + ", logoFullPath=" + logoFullPath + ", onColor=" + onColor
			+ ", offColor=" + offColor + ", margin=" + margin + ", level=" + level + "]";
}

/**
 * 返回文件后缀名
 *
 * @return
 */
public String getSuffixName() {
    String imgName = this.getFileName();
    if (imgName != null && !"".equals(imgName)) {
        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
        return suffix;
    }
    return "";
}


}
